Calling _teardownPipeline() before _tryNextPipeline() was actually not a
good idea, it sets the pipelineState to STOPPED, which means we can't try
any of the following pipelines anymore.
Instead what we want to do is set the pipeline state of the old pipeline to
NULL when trying a new one, without calling _teardownPipeline() for that.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2754>
_tryNextPipeline() {
const {done, value: pipelineConfig} = this._pipelineConfigs.next();
if (done) {
- this._teardownPipeline();
this._handleFatalPipelineError('All pipelines failed to start');
return;
}
+ if (this._pipeline) {
+ if (this._pipeline.set_state(Gst.State.NULL) !== Gst.StateChangeReturn.SUCCESS)
+ log('Failed to set pipeline state to NULL');
+
+ this._pipeline = null;
+ }
+
try {
this._pipeline = this._createPipeline(this._nodeId, pipelineConfig,
this._framerate);
retval === Gst.StateChangeReturn.ASYNC) {
// We'll wait for the state change message to PLAYING on the bus
} else {
- this._teardownPipeline();
this._tryNextPipeline();
}
}